"""
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    created by siyi.chen on '21/11/2024'
    comment: 接口定义的model
"""
from typing import Optional

from fastapi import Body, UploadFile
from laner.pydantic import BaseModel


class InterCariabotColumnService(BaseModel):
    """ Cariabot侧边栏目服务列表
    """
    code: str = Body('', title='编号')
    name: str = Body('', title='名称')
    image: str = Body('', title='图片')
    custom_icon: Optional[str] = Body(None, title='自定义图标base64文件')
    url: str = Body('', title='链接')
    preamble: str = Body('', title='数字人对白')


class InterCariabotColumn(BaseModel):
    """ Cariabot侧边栏目
    """
    id: int = Body('', title='栏目id', description='新增时不传')
    name: str = Body(..., title='栏目名称')
    icon_checked: str = Body('', title='图标选中状态')
    icon_unchecked: str = Body('', title='图标未选中状态')
    custom_icon_checked: Optional[str] = Body(None, title='自定义图标base64文件，选中状态')
    custom_icon_unchecked: Optional[str] = Body(None, title='自定义图标base64文件，未选中状态')
    column_type: str = Body('', title='栏目类型', description='flow(服务流程)/card(服务卡片)/evaluation(健康评估)/sleep(睡眠方案)/human(呼叫前台)/home(返回首页)/external(外部模块)')
    service_list: list[InterCariabotColumnService] = Body([], title='服务列表')
    tags: list[str] = Body([], title='标签列表')
    preamble: str = Body('', title='栏目开场白')
    human_phone: str = Body('', title='前台电话')
    human_nickname: str = Body('', title='前台昵称')
    h5_url: str = Body('', title='H5链接')


class InterCariabot(BaseModel):
    """ Cariabot自定义信息
    """
    background_image: str = Body('', title='背景图')
    digital_human_id: str = Body('', title='数字人id')
    digital_human_image: str = Body('', title='数字人图片')
    awaken: str = Body('', title='唤醒词')
    voice_icon: str = Body('', title='语音图标')
    columns: list[InterCariabotColumn] = Body([], title='侧边栏目')


class InterInvoice(BaseModel):
    """ 发票信息
    """
    room_number: str = Body(..., title='房间号')
    invoice_type: str = Body(..., title='发票类型')
    title_type: str = Body(..., title='抬头类型')
    invoice_title: str = Body(..., title='发票抬头')
    tax_number: str = Body('', title='税号')
    email: str = Body('', title='邮箱')
    bank_name: str = Body('', title='开户银行')
    bank_account: str = Body('', title='银行账号')
    company_address: str = Body('', title='公司地址')
    company_phone: str = Body('', title='公司电话')
